import os


def make_dir(path):
    if os.path.exists(path):
        pass
    else:
        os.makedirs(path)


def save_files(base_path, content, file_name):
    """
    保存文件
    :param base_path:  文件保存目录
    :param content: 文件内容
    :param file_name: 文件名字
    :return:
    """
    make_dir(base_path)
    path = os.path.join(base_path, file_name)
    with open(path, 'wb') as f:
        f.write(content)
    return path
